<?php

// Frapify Keychain - wfk-options.php
// Author - Tom Guthrie (http://frapify.freehostia.com/)
//
// $Id: wfk-options.php R24 2007-01-11 tomguthrie $
//

function wfk_AddOptionPage() {
	
	if ( function_exists('add_options_page') ) {
		
		add_options_page('Frapify Keychain', 'Frapify Keychain', 0, 'wp-frapify-keychain.php', 'wfk_OptionsPage');
		
	}
	
}

function wfk_CheckConnectionOptions() {
	
	if ( wfk_CheckConnection() == true ) {
		
		return true;
		
	}

?>
<div class="error">
	<p><a href="http://frapifkeychain.com/docs?error=1">More Info</a><strong>Warrning!</strong>Can't connect to Frapify Keychain Host!</p>
</div>
<?php
	
}

function wfk_OptionsHeader() {

	// stop if not on page
	if ( $_GET['page'] != 'wp-frapify-keychain.php' ) {
		
		return false;
		
	}

	include('wfk-header.php');
	
}

function wfk_OptionsPage() {

	global $pagetoload;

	// first we need to check if we need to say "Get a frapify site key!" ...
	if ( !get_option('wfk') ) {
	
		wfk_CheckConnectionOptions();
		
		wfk_pageloader();
		
		include($pagetoload);
		
		//include('wfk-sitekey.php');

	}

}

function wfk_OptionsFooter() {

	global $r;

	// stop if not on page
	if ( $_GET['page'] != 'wp-frapify-keychain.php' ) {
		
		return false;
		
	}

	echo '<p style="color: grey; text-align: center;">Frapify Keychain &raquo; 1<sup>R'.$r.'</sup></p>';
	
}

?>